package openase.audiosearch.comm.response.decoder.facade;

import java.nio.ByteBuffer;

import openase.audiosearch.comm.response.Response;
import openase.audiosearch.comm.response.ResponseType;
import openase.audiosearch.comm.response.decoder.ResponseDecoder;
import openase.audiosearch.comm.response.decoder.factory.ResponseDecoderFactory;

public abstract class ResponseDecoderFacade {

	public static Response decode(ByteBuffer input) {
		byte code = input.get();
		ResponseType responseType = ResponseType.getType(code);

		ResponseDecoder<?> decoder = ResponseDecoderFactory.getDecoder(responseType);
		return decoder.decode(input);
	}

}
